//
// Created by Luhang on 2023/10/11/011.
//
//日志消息类
//封装一条完整的日志消息所需的内容
//包含：日志等级，日志器名字，文件名，行号，日志有效信息，时间，线程ID

#ifndef LOGPROJECT_MESSAGE_H
#define LOGPROJECT_MESSAGE_H

#include <thread>
#include <utility>
#include "util.hpp"
#include "level.hpp"

namespace LuLog{
    struct LogMsg{
        size_t _ctime;
        size_t _line;
        std::string _name;
        std::string _file;
        std::string _payload;
        std::thread::id _tid;
        LogLevel::level _level;

        LogMsg(LogLevel::level level, 
                std::string name, 
                std::string file, 
                size_t line, 
                std::string payload):
                _line(line), 
                _name(name), 
                _file(file), 
                _payload(payload), 
                _level(level), 
                _ctime(util::Date::now()), 
                _tid(std::this_thread::get_id()){}
    };
}

#endif //LOGPROJECT_MESSAGE_H